﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersonStalker 
{
    public class Person : IPropertyChangeNotification
    {
        private string firstName;
        private string lastName;
        private PersonGender gender;
        private DateTime birthDate;

        public string FirstName
        {
            get { return firstName; }
            set { OnPropertyChanged("FirstName", firstName, value); firstName = value; }
        }
        public string LastName
        {
            get { return lastName; }
            set { OnPropertyChanged("LastName", lastName, value); lastName = value; }
        }
        public PersonGender Gender
        {
            get { return gender; }
            set { OnPropertyChanged("Gender", gender, value); gender = value; }
        }
        public DateTime BirthDate
        {
            get { return birthDate; }
            set { OnPropertyChanged("BirthDate", birthDate, value); birthDate = value; }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string name, object oldValue, object newValue)
        {
            if (PropertyChanged != null)
            {
                PropertyChangedEventArgs e = new PropertyChangedEventArgs(name, oldValue, newValue);
                PropertyChanged(this, e);
            }
        }

    }
}
